﻿using System;
using System.Collections.Generic;
using System.Linq;
using ProjScan.Tools;

namespace ProjScan.ScanRule.EditorSettings
{
	// Token: 0x020001FC RID: 508
	internal abstract class GlobalEditorSettingRule : GlobalRule
	{
		// Token: 0x06000F06 RID: 3846 RVA: 0x00042FF4 File Offset: 0x000411F4
		public void AnalysisFixData()
		{
			bool flag = this.failAssetInfos == null;
			if (flag)
			{
				FailedAssetInfo failedAssetInfo = new FailedAssetInfo();
				failedAssetInfo.IsFixed = false;
				failedAssetInfo.ShouldBeFixed = true;
				this.failAssetInfos = new Dictionary<string, FailedAssetInfo>();
				this.failAssetInfos.Add(this.dataID.ToString(), failedAssetInfo);
			}
			bool flag2 = this.failAssetInfos.Count <= 1;
			if (flag2)
			{
				this.failedAssetInfo = Enumerable.ToList<FailedAssetInfo>(this.failAssetInfos.Values)[0];
			}
			else
			{
				FixLog.Instance.Log(FixLog.LogLevel.EXCEPTION, FixLog.FixStage.f3, "To Many Paths Data when Loading EditerSetting Fix Data");
			}
		}

		// Token: 0x06000F07 RID: 3847 RVA: 0x00043094 File Offset: 0x00041294
		public override void FixRule()
		{
			this.AnalysisFixData();
			bool flag = this.failedAssetInfo.ShouldBeFixed && !this.failedAssetInfo.IsFixed;
			if (flag)
			{
				bool flag2 = this.InvokeFixer("This is Meant for Non-Path Fixer, No Path Given");
				if (flag2)
				{
					this.failedAssetInfo.IsFixed = true;
				}
				FixLog.Instance.Log(this.fixerType, "");
			}
			Dictionary<string, FailedAssetInfo> failAssetInfos = this.failAssetInfos;
			foreach (KeyValuePair<string, FailedAssetInfo> keyValuePair in this.failAssetInfos)
			{
				string text = keyValuePair.Key.ToString();
				char[] separator = new char[]
				{
					'$'
				};
				string a = Enumerable.ToList<string>(text.Split(separator))[0];
				bool flag3 = a == this.SceneName;
				if (flag3)
				{
					failAssetInfos[text] = this.failedAssetInfo;
				}
			}
			this.failAssetInfos = failAssetInfos;
		}
	}
}
